package com.wuxiaofan.ware.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.ware.entity.WareOrderTaskDetail;
import com.wuxiaofan.ware.entity.custom.WareOrderTaskDetailCustom;
import com.wuxiaofan.ware.mapper.WareOrderTaskDetailMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.ware.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class WareOrderTaskDetailService {
    @Autowired
    private WareOrderTaskDetailMapper wmsWareOrderTaskDetailMapper;
    @Resource
    private Idgenerator idgenerator;
    public WareOrderTaskDetail findById(String id){
        return wmsWareOrderTaskDetailMapper.selectById(id);
    }

    public WareOrderTaskDetailCustom findCountByMap(Map paraMap){
        return wmsWareOrderTaskDetailMapper.findCountByMap(paraMap);
    }

    public WareOrderTaskDetailCustom findGroupByMap(Map paraMap){
        return wmsWareOrderTaskDetailMapper.findGroupByMap(paraMap);
    }

    public List<WareOrderTaskDetailCustom> findByMap(Map paraMap){
        return wmsWareOrderTaskDetailMapper.findByMap(paraMap);
    }

    public Page<WareOrderTaskDetailCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(wmsWareOrderTaskDetailMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        wmsWareOrderTaskDetailMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        wmsWareOrderTaskDetailMapper.deleteById(id);
    }

    public WareOrderTaskDetail save(WareOrderTaskDetail wmsWareOrderTaskDetail){
        wmsWareOrderTaskDetail.setId(idgenerator.getId());
        wmsWareOrderTaskDetailMapper.insert(wmsWareOrderTaskDetail);
        return wmsWareOrderTaskDetail;
    }

}
